package core.bmp.worker.color;

import core.bmp.model.Pixel;
import core.bmp.utils.PixelUtil;

public class BinaryWorker extends GrayWorker {

	private static final byte MID = (byte) 0xA0;
	private static final byte BLK = (byte) 0x00;
	private static final byte WHITE = (byte) 0xFF;

	/* 继承 */

	@Override
	public void handlerPix(Pixel pixel) {
		super.handlerPix(pixel);
		if (pixel.getRed() < MID) {// 黑色的
			PixelUtil.setGray(pixel, BLK);
		} else {
			PixelUtil.setGray(pixel, WHITE);
		}
	}

}
